The present invention provides a system of objects and program components wherein an object accesses different associated program components for different implementations of a corresponding function of the object.
In object-oriented software the software program is organized as a set of discrete modules or objects, which comprise both a data structure and behavior. An object is a run-time entity with its own thread or threads of execution with its own system resources. Objects with the same data structure and behavior (operations) are grouped into a class. Each object is an instance of a certain class. The operations determine the message to which the object can respond, while the state is hidden from the outside like for example other objects. The operations on the objects are called methods.
Each object has an execution environment which describes the properties of the object e.g. which memory areas the object can access, which threads the object code execute and which is the run-time environment of the object. Communication between objects occurs by message passing. In EP 0 871 119 A1 a form of message passing is described. To execute message passing each object has an external interface, also called send interface, which arranges the receiving of the message and with which the different methods of the corresponding object are operable.
Known object-oriented software programs implement the concept of polymorphism. Polymorphism is often considered the most powerful facility of an object-oriented language. Polymorphism means the ability to take several forms. In the context of object-oriented software, this means that for the same entity to refer at run-time to instances of various classes. A restricted view of this is that the same operation may behave differently on different classes. However in the known object-oriented software programs the concept of polymorphism is implemented only at objects level.
Therefore, it is the object underlying the present invention to provide polymorphism at a much smaller level, i.e. at a level of program components, each of which is an element of an object that implements one responsibility of that object. Contrary to known systems of software the present invention provides a system wherein the same function of an object can hide a call to different program components, i.e. different pieces of program code, wherein different implementations of a function are given, without changing or altering the object itself. More specifically, a function call from an object can contain different parameters, whereas the same function call may result in the invocation of different program components with different implementations of the function of the object, depending on these parameters. An object can therefore use different program components with an identical internal interface simultaneously by loading the program components explicitly into memory and calling them.
The system according to the present invention therefore comprises:
a first object having one or more functions;
a first program component having one or more functions, the first program component being dynamically linked to the first object at a run-time of the first object; and wherein the first object access the first program component using a function call which may result in the access to a second program component having one or more functions.
The first program component resides in a first execution environment of the first object. The second program component provides the same interface as the first program component provides to the first object, wherein the first and the second program component have no own thread and resources.